package com.wuh.service.impl;

import com.wuh.mapper.TeacherCommentMapper;
import com.wuh.model.TeacherComment;
import com.wuh.service.TeacherCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教师评价表业务层
 */
@Service
public class TeacherCommentServiceImpl implements TeacherCommentService {

    @Autowired
    private TeacherCommentMapper teacherCommentMapper;


    /**
     * 根据comentId查询单条评价信息
     *
     * @param comentId 主键
     * @return
     */
    @Override
    public TeacherComment queryCommentById(Integer comentId) {
        return teacherCommentMapper.queryCommentById(comentId);
    }

    /**
     * @param teacherComment 实例对象
     * @return
     */
    @Override
    public List<TeacherComment> queryCommentAll(TeacherComment teacherComment) {
        return teacherCommentMapper.queryCommentAll(teacherComment);
    }

    /**
     * 添加评论
     *
     * @param teacherComment 实例对象
     * @return
     */
    @Override
    public int addComment(TeacherComment teacherComment) {
        return teacherCommentMapper.addComment(teacherComment);
    }

    /**
     * 修改评论
     *
     * @param teacherComment 实例对象
     * @return
     */
    @Override
    public int updateComment(TeacherComment teacherComment) {
        return teacherCommentMapper.updateComment(teacherComment);
    }

    /**
     * 根据comentId删除评论
     */
    @Override
    public int deleteCommentById(Integer comentId) {
        return teacherCommentMapper.deleteCommentById(comentId);
    }
}
